package java51.demo18;

import java.util.LinkedList;
import java.util.List;

public class ListTest3 {

	public static void main(String[] args) {
		List l2 = new LinkedList();
		l2.add("李慧");
		l2.add("吴玉波");
		l2.add("徐涛");
		l2.add("吴翔");
		l2.add(new Dog("大花", "黑", 3));
		l2.add(new Dog("二花", "黄", 3));
		l2.add(new Dog("哮天犬", "灰", 3));
		l2.add(new Dog("如花", "白", 3));
		Dog dog = new Dog("二狗子", "花", 6);
		l2.add(dog);
		System.out.println("输出所有的集合数据：");
		for (int i = 0; i < l2.size(); i++) {
			System.out.println(l2.get(i));
		}
		System.out.println(">>>>>>>>>>>>>>>>");
		// boolean in = l2.contains(dog);
		// System.out.println(dog.getName() + "在？" + in);
		Dog d1 = new Dog("二狗子", "白", 4);
		boolean in = l2.contains(d1);
		System.out.println("在不在？" + in);
		System.out.println("位置在" + l2.indexOf(d1));
		// >>>>
	}

}
